﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class BG_Manage_BG_ChangePWD : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Session["User"] = "sss";
            txtUserName.Value = Session["User"].ToString();
        }

    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        
        if (IsValid)
        {
            VPINews.BLL.Admin bll_admin = new VPINews.BLL.Admin();
            VPINews.Model.Admin mod_admin = new VPINews.Model.Admin();

            string UserName = this.txtUserName.Value;
            string PassWord = this.txtPWDOK.Value;

            mod_admin.UserName = UserName;
            mod_admin.PassWord = PassWord;

            if (bll_admin.Exists(UserName))
            {
                bll_admin.Update(mod_admin);
                smslabel.Text = "密码修改成功";
            }
            else
            {
                smslabel.Text = "密码修改失败";

            }
        }
    }
    protected void btnReset_Click(object sender, EventArgs e)
    {
        smslabel.Text = "";
        txtUserName.Value = "";
        txtPWD.Value = "";
        txtPWDOK.Value = "";
    }
}
